package com.sxran.im.handler;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sxran.im.dao.ImGroupMapper;
import com.sxran.im.dao.ImUserGroupMapper;
import com.sxran.im.dao.ImUserMapper;
import com.sxran.im.info.ImGroup;
import com.sxran.im.info.ImUser;
import com.sxran.im.info.ImUserGroup;
import com.sxran.im.service.UserGroupService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class LoginCmdHandler extends UserInfoCmdHandler{

    private Logger logger = LoggerFactory.getLogger(LoginCmdHandler.class);

    @Resource
    private ImUserMapper imUserMapper;




    @Override
    public Object doBeanService(ImUser bean) {
        // 校验

        // 获得用户信息返回。
        ImUser imUser = (ImUser) super.doBeanService(bean);


        // 设置状态为上线。
        imUser.setStatus(0);
        imUserMapper.updateById(imUser);
        return imUser;
    }
}
